<?php

class Application_Model_Photo
{
	protected $_phoNum;
	protected $_pilNum;
	protected $_phoSujet;
	protected $_phoCommentaire;
	protected $_phoAdresse;

	public function __construct(array $options = null)
	{
		if(is_array($options))
		{
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if(('mapper' == $name) || !method_exists($this, $method))
		{
			throw new Exception('Invalid pilote property');
		}
		$this->$method($value);
	}
	public function __get($name)
	{
		$method = 'get' . $name;
		if(('mapper' == $name) || !method_exists($this, $method))
		{
			throw new Exception('Invalid pilote property');
		}
		return $this->$method();
	}

	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value)
		{
			$method = 'set' . ucfirst($key);
			if(in_array($method, $methods))
			{
				$this->$method($value);
			}
		}
		return $this;
    }
	
    public function setPhoNum($phoNum)
	{
		$this->_phoNum = (int)$phoNum;
		return $this;
	}
	public function getPhoNum()
	{
		return $this->_phoNum;
	}
    
	public function setPilNum($pilNum)
	{
		$this->_pilNum = (int)$pilNum;
		return $this;
	}
	public function getPilNum()
	{
		return $this->_pilNum;
	}

	public function setPhoSujet($phoSujet)
	{
		$this->_phoSujet = (string)$phoSujet;
		return $this;
	}
	public function getPhoSujet()
	{
		return $this->_phoSujet;
	}

	public function setPhoCommentaire($phoCommentaire)
	{
		$this->_phoCommentaire = (string)$phoCommentaire;
		return $this;
	}
	public function getPhoCommentaire()
	{
		return $this->_phoCommentaire;
	}

	public function setPhoAdresse($phoAdresse)
	{
		$this->_phoAdresse = (string)$phoAdresse;
		return $this;
	}
	public function getPhoAdresse()
	{
		return $this->_phoAdresse;
	}
}